package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@Controller
public class HelloController {

	
	@GetMapping("/h")
	public String hello() {
		String property = System.getProperty("java.class.path");
		System.out.println(property);
		
		int i = 1/0;
		return "hello";
	}
	
	
	@PostMapping("/upload")
	public String upload(
			@RequestParam("email") String email,
			@RequestParam("username") String username,
			@RequestPart("headerImg") MultipartFile headerImg,
			@RequestPart("photos") MultipartFile[] photos
			
			) {
		Thread.currentThread().getClass().getClassLoader();
		return "main";
	}
	
	
}
